//
//  CustomDailButton.m
//  LocomotiveGuards
//
//  Created by zwj on 15-12-9.
//  Copyright (c) 2015年 REDOOR. All rights reserved.
//

#import "CustomDailButton.h"

@implementation CustomDailButton
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _dailImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10*W, 5*H, 20*H, 20*H)];
        [self addSubview:_dailImageView];

        _dailLabel = [[UILabel alloc] initWithFrame:CGRectMake(34*W, 5*H, 60*W, 20*H)];
        _dailLabel.text = @"拨打号码";
        _dailLabel.textAlignment = NSTextAlignmentCenter;
        _dailLabel.textColor = [UIColor grayColor];
        _dailLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:_dailLabel];
    }
    return self;
}

- (void)setOn:(BOOL)on
{
    _on = on;
    if (on) {
        [_dailImageView setImage:[UIImage imageNamed:@"phone_on"]];
    }
    else {
        [_dailImageView setImage:[UIImage imageNamed:@"phone"]];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
